
import {menulist} from '../../../request/api'
const state = {
    menuList:[]
}

const getters={
    getMenu(state){
      return  state.menuList
    }
}

const mutations = {
    CHANGEM(state,payload){
        state.menuList = payload
    }
}

const actions = {
    GetMenuInfo({commit}){
        // 调用接口
        menulist({istree:true})
        .then(res=>{
            if(res.code ==200){
                commit('CHANGEM',res.list)
            }
        })
    }

}

export default {
state,getters,mutations,actions,
// 开启命名空间
namespaced:true
}